import socket
import time

s_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
s_sock.setblocking(False)
s_sock.bind(("0.0.0.0", 3000))
while True:
    print("Be ready for the data.")
    while True:
        try:
            data, address = s_sock.recvfrom(1000)
            break
        except Exception as e:
            time.sleep(1)
            print("Runing ........")
            continue

    print("Receive data:" + data.decode("utf-8"))
    s_sock.sendto(data, address)

s_sock.close()